<script>
  import { onMount } from "svelte"
  import toast, { Toaster } from "svelte-french-toast"

  //   onMount(() => {
  //     toast.success("It works!")
  //   })
  function dmeo() {
    toast(name + "\n\n今天天气不错", {
      icon: "👏",
      position: "top-right",
      duration: 3000,
      type: "success",
    })
    // toast.promise(demo(name), {
    //   loading: "Saving...",
    //   success: "Settings saved!",
    //   error: "Could not save.",
    // })
  }
  function demo(params) {
    return true
  }
  let name = "通知测试"
</script>

<Toaster />

<button w-30 h20 bg-yellow on:click={dmeo}>{name}</button>
